package entityUpdater

import (
	"go-fox-edge-persist/entityAdapter"
)

var (
	EntityUpdater              *entityUpdater
	deviceObjectMapper         *DeviceObjectMapper
	deviceCommStatusUpdater    *DeviceCommStatusUpdater
	deviceStatusValueUpdater   *DeviceStatusValueUpdater
	deviceRecordValueUpdater   *DeviceRecordValueUpdater
	deviceSequenceValueUpdater *DeviceSequenceValueUpdater
	operateRecordValueUpdater  *OperateRecordValueUpdater
	DeviceHistoryAdapter       entityAdapter.IDeviceHistoryAdapter
	DeviceValueRecordAdapter   entityAdapter.IDeviceValueRecordAdapter
	DeviceSequenceAdapter      entityAdapter.IDeviceSequenceAdapter
	Verify                     *EntityVerify
)

const (
	mapperModeOriginal  = 0
	mapperModeReplace   = 1
	mapperModeDuplicate = 2
	mapperModeFilter    = 3
	mapperModeExpend    = 4
)

func init() {
	deviceObjectMapper = &DeviceObjectMapper{}
	deviceObjectMapper.mapperEntityMap = make(map[string]interface{})

	deviceRecordValueUpdater = &DeviceRecordValueUpdater{}
	deviceRecordValueUpdater.recordLastTime = make(map[string]int64)

	deviceSequenceValueUpdater = &DeviceSequenceValueUpdater{}

	EntityUpdater = &entityUpdater{}
	deviceCommStatusUpdater = &DeviceCommStatusUpdater{}
}

func SyncEntity() {
	deviceObjectMapper.syncEntity()
}
